<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./JS/vue.js"></script>
</head>
<body>
    <div id="app">
        <cpn></cpn>
        <cpn></cpn>
        <cpn></cpn>
    </div>
    <template id="cpn">
        <div>
            <h2>{{count}}</h2>
            <button @click="increment">+</button>
            <button @click="decrement">-</button>
        </div>
    </template>
    <script>

        Vue.component('cpn',{
            template: '#cpn',
            data () {
                return {
                    count:0
                }}
                ,
                methods: {
                    increment(){
                        this.count++
                    },
                    decrement(){
                        this.count--
                    }
                }
        })

        const app = new Vue({
            el: '#app',
            data:{

            }
        })
    </script>
</body>
</html>